package com.xxb.system.feign.callback;

import com.xxb.system.feign.service.order.OrderServiceFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author RenGaoshuai
 * @date 2023/7/27 16:31
 * @description
 */
@Service
@Slf4j
public class OrderServiceFallBackFactory implements FallbackFactory<OrderServiceFeign> {
    @Override
    public OrderServiceFeign create(Throwable throwable) {
        // 打印一下
        throwable.printStackTrace();
        // 输出日志,方便后面进行elk
        log.error("OrderServiceFeign error:", throwable);
        return new OrderServiceFeign() {};
    }
}
